package com.sky.wsp.spring.jackson.controller;

import com.sky.wsp.spring.jackson.vo.UserReqVO;
import com.sky.wsp.spring.jackson.vo.UserRspVO;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

/**
 * @author wangshaopeng@talkweb.com.cn
 * @desccription 在此输入描述
 * @date 2023/5/30
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping
    public UserRspVO get() {
        UserRspVO rsp = new UserRspVO();
        rsp.setId(1L);
        rsp.setName("张三");
        rsp.setMobile("18866661234");
        rsp.setEmail("zhangsan@qq.com");
        rsp.setIdentity("434113199901015566");
        return rsp;
    }

    @PutMapping
    public UserRspVO put(@RequestBody UserReqVO req) {
        System.out.println(req);
        UserRspVO rsp = new UserRspVO();
        BeanUtils.copyProperties(req, rsp);
        return rsp;
    }
}
